package com.lc.afbx.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.TextView;

import com.lc.afbx.BaseApplication;
import com.lc.afbx.R;
import com.lc.afbx.conn.GetApiSJRZDetails;
import com.lc.afbx.util.PrefrenceConfig;
import com.zcx.helper.activity.AppV4Fragment;
import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.util.UtilToast;

/**
 * Created by Administrator on 2016/9/18.
 */
public class FragmentBusinessJoinDetailConnect extends AppV4Fragment {

    private TextView address;
    private TextView phoneNum;

    private GetApiSJRZDetails getApiSJRZDetails = new GetApiSJRZDetails(new AsyCallBack<GetApiSJRZDetails.Info>() {

        @Override
        public void onSuccess(String toast, int type, GetApiSJRZDetails.Info info) throws Exception {


            Log.e("这是webViewqqq的地址:", info.data.address);
            Log.e("这是webViewqwew的地址:", info.data.tel);

            address.setText(info.data.address);
            phoneNum.setText(info.data.tel);

        }

        @Override
        public void onFail(String toast, int type) throws Exception {

            UtilToast.show(getActivity(), toast);
        }
    });

    public static Fragment newInstance(String id) {

        FragmentBusinessJoinDetailConnect fragmentBusinessJoinDetailConnect = new FragmentBusinessJoinDetailConnect();

        Bundle bundle = new Bundle();

        bundle.putString("id", id);

        fragmentBusinessJoinDetailConnect.setArguments(bundle);

        return fragmentBusinessJoinDetailConnect;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_businessjoin_detail_connect, null);

        BaseApplication.ScaleScreenHelper.loadView((ViewGroup) view);

        address = (TextView) view.findViewById(R.id.address);
        phoneNum = (TextView) view.findViewById(R.id.phoneNum);


        getApiSJRZDetails.id = getArguments().getString("id");
        getApiSJRZDetails.tid = PrefrenceConfig.TWO;
        getApiSJRZDetails.execute(getActivity());


        return view;

    }


}
